package com.yuncheng.spcyApi.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yuncheng.spcyApi.entity.SpcySqsxHymx;
import com.yuncheng.spcyApi.entity.SpcySqsxHyzt;
import com.yuncheng.spcyApi.mapper.SpcySqsxHyztMapper;
import com.yuncheng.spcyApi.service.ISpcySqsxHyztService;
import com.yuncheng.spcyApi.vo.xcjchy.SqsxHyLxVo;
import org.springframework.stereotype.Service;

import com.yuncheng.common.base.service.impl.BaseServiceImpl;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description: 申请事项-会议主题
 * @Author: yuncheng
 * @Date: 2024-03-07
 * @Version: V1.0
 */
@Service
public class SpcySqsxHyztServiceImpl extends BaseServiceImpl<SpcySqsxHyztMapper, SpcySqsxHyzt> implements ISpcySqsxHyztService {

    @Resource
    private SpcySqsxHyztMapper spcySqsxHyztMapper;

    @Override
    public String selectFsqsxidById(String id) {
        return spcySqsxHyztMapper.selectFsqsxidById(id);
    }

    @Override
    public List<SpcySqsxHymx> selectHymxByFsqsxid(String sqsxid, String fhylx) {
        return spcySqsxHyztMapper.selectHymxByFsqsxid(sqsxid, fhylx);
    }

    @Override
    public String selectFhylxById(String id) {
        return spcySqsxHyztMapper.selectFhylxById(id);
    }

    @Override
    public SqsxHyLxVo selectFhylxAndFsqsxidById(String id) {
        return spcySqsxHyztMapper.selectFhylxAndFsqsxidById(id);
    }

    @Override
    public boolean updateHyFstate(String id, String state) {
        LambdaUpdateWrapper<SpcySqsxHyzt> updateWrapper = new LambdaUpdateWrapper<>();
        updateWrapper.eq(SpcySqsxHyzt::getId, id);

        SpcySqsxHyzt updateBean = new SpcySqsxHyzt();
        updateBean.setFstate(state);

        return update(updateBean, updateWrapper);
    }

    @Override
    public List<String> selectHyQxqksmByFsqsxid(String sqsxid) {
        return spcySqsxHyztMapper.selectHyQxqksmByFsqsxid(sqsxid);
    }

    @Override
    public List<String> selectHyIdListByFsqsxid(String sqsxid) {
        return spcySqsxHyztMapper.selectHyIdListByFsqsxid(sqsxid);
    }

    @Override
    public void deleteHymxByFSqsxidAndUserIds(String sqsxid, List<String> userIds) {
        spcySqsxHyztMapper.deleteHymxByFSqsxidAndUserIds(sqsxid, userIds);
    }
}
